import React from 'react';
import { View, Image } from '@tarojs/components';
import pNoTip from '@/images/common/noTip.png';
import pNoDate from '@/giftCardSubPack/images/points/nodate.png';
import './index.scss';

const EmptyTip = ({ type = 'normal', text = '', className = '' }) => {
  let txt = '暂无信息';
  let src = pNoTip;
  switch (type) {
    case 'noShop':
      txt = '该类目下无店铺哦，逛逛别的吧~';
      break;
    case 'noProduct':
      txt = '该类目下无商品哦，逛逛别的吧~';
      break;
    case 'noSearch':
      txt = '暂无相关内容，搜搜别的吧~';
      break;
    case 'noPointRecord':
      src = pNoDate;
      txt = '暂无积分明细';
      break;
    default:
      break;
  }
  if (text.length > 0) {
    txt = text;
  }
  return (
    <View className={['emptyTip', className].join(' ')}>
      <View className={['tipCnt', src == pNoDate && 'noDate'].join(' ')}>
        <Image className="tipPic" src={src}></Image>
        <View className="tipTxt">{txt}</View>
      </View>
    </View>
  );
};

export default EmptyTip;
